<%@ page import="com.zou.beans.Photo" %>
<%@ page import="com.zou.beans.User" %>
<%@ page import="java.util.List" %>
<%@ page import="com.zou.dao.BaseDao" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>图片墙</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
    img {
        height: 150px
    }

    img {
        transition: all 100ms ease;
    }

    img:hover {
        transform: scale(2, 2);
        transition: all 200ms ease;
        border-radius: 10px 10px;
        box-shadow: 40px 40px 40px #aaa;
    }

    body {
        text-align: center;
        background-image: url('./images/bg.jpg')
    }
</style>
<body>
<%
    List<Photo> list = (List<Photo>) request.getAttribute("PhotoWallList");
    Long userId;
    User user = (User) session.getAttribute("User");
    if (user == null) {
        response.sendRedirect("login.jsp");
        userId = Long.valueOf(request.getParameter("userId"));
    } else {
        userId = user.getId();
    }
%>

<!--顶部导航栏部分-->
<nav class="navbar navbar-dark sticky-top bg-success flex-md-nowrap p-0 shadow">
    <a class="navbar-brand col-md-3 col-lg-2 mr-0 px-3"
       href="https://blog.csdn.net/Zou_05">&emsp;&emsp;&emsp;小邹喜欢Java</a>
    <div class="btn-group" style="margin-right: 100px">
        当前用户：<%=user.getName()%>
    </div>
</nav>
<div style="padding: 20px 0 20px 0;text-align: right;margin-right: 100px">
    <a class="btn btn-primary" href="editPhoto.jsp?id=<%=0L%>&master=<%=userId%>">上传图片</a>
    <a class="btn btn-info" href="ShowPhotoServlet?userId=<%=userId%>">我的相册</a>
    <a class="btn btn-danger" href="LoginServlet">退出登录</a>
</div>
<%
    for (Photo photo : list) {
%>
<a href="AddPhotoCollectionServlet?photoId=<%=photo.getId()%>&flag=00"><img
        src="<%=photo.getUrl()%>"></a>
<%
    }
%>
</body>
</html>
